package com.freecloud.bitorrent.constant;

import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Author: maomao
 * @Date: 2022/7/15 5:44 PM
 */
public class BitTorrentConstant {

    /**
     * 启动节点列表
     */
    //    public static final List<InetSocketAddress> BOOTSTRAP_NODES = new ArrayList<>(
    //        Arrays.asList(new InetSocketAddress("router.bittorrent.com", 6881),
    //            new InetSocketAddress("dht.transmissionbt.com", 6881), new InetSocketAddress("router.utorrent.com", 6881),
    //            new InetSocketAddress("dht.aelitis.com", 6881)));
    public static final List<InetSocketAddress> BOOTSTRAP_NODES =
        new ArrayList<>(Arrays.asList(new InetSocketAddress("127.0.0.1", 6881)));

    /**
     * 查询节点ID
     */
    public static final String DHT_MESSAGE_ID = "id";
    /**
     * 表示操作类型
     */
    public static final String DHT_MESSAGE_QUERY = "q";
    /**
     * 描述消息类型 q表示查询、r表示响应、e表示错误
     */
    public static final String DHT_MESSAGE_TYPE = "y";
    /**
     * 事务ID
     */
    public static final String DHT_MESSAGE_TRANSACTION_ID = "t";
    /**
     * 查询参数
     */
    public static final String DHT_MESSAGE_ARGUMENTS = "a";
    /**
     * 版本号
     */
    public static final String DHT_MESSAGE_VERSION = "v";

    /**
     * ARGUMENTS参数名，目标节点
     */
    public static final String DHT_ARGUMENTS_TARGET = "target";

}
